<ng-template #tpl>
  <h1>asdsadasdasd</h1>
</ng-template>
<ng-container>
  我是ng-container
</ng-container>
<ul>
  <li #item *ngFor="let i of list; let idx = index; trackBy: idx">
    {{ i }} - {{ idx }}
  </li>
</ul>
<form (ngSubmit)="onLogin()" #form="ngForm" class="form-box">
  <div class="form-group">
    <label #labelTel>手机号码</label>
    <input
      type="text"
      name="phone"
      #phone="ngModel"
      class="form-control"
      placeholder="请输入手机号码"
      [(ngModel)]="formInfo.phone"
      required
      pattern="1[3,4,5,6,7,8]\d{9}"
    />

    <div class="errors" [hidden]="phone.valid || phone.untouched">
      <p *ngIf="phone?.errors?.required">请输入手机号码</p>
      <p *ngIf="phone?.errors?.pattern">手机号码不合法</p>
    </div>
  </div>
  <div class="form-group">
    <label>密码</label>
    <input
      type="password"
      name="password"
      #password="ngModel"
      class="form-control"
      placeholder="请输入密码"
      [(ngModel)]="formInfo.password"
      required
    />
    <div class="errors" [hidden]="password.valid || password.untouched">
      <p *ngIf="password?.errors?.required">请输入密码</p>
    </div>
  </div>
  <button type="submit" class="btn btn-default" [disabled]="form.invalid">
    登陆
  </button>
</form>
